import AMapLoader from "@amap/amap-jsapi-loader";

export default function loadAMap() {
  return new Promise((resolve, reject) => {
    // const mapConfig = {
    //   securityJsCode: "b23c850a95afb3ca622bedf6efa527df",
    //   MAPKEY: "9b855993ebffd74a39d44888fff209f7",
    // };
    window._AMapSecurityConfig = {
      securityJsCode: "b23c850a95afb3ca622bedf6efa527df",
    };
    AMapLoader.load({
      key: "9b855993ebffd74a39d44888fff209f7", // 设置您的key
      version: "2.0",
      plugins: [],
    })
      .then((AMap) => {
        resolve(AMap);
      })
      .catch((e) => {
        reject(e);
      });
  });
}
